﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Medianamik.UI.Mediasend.Logic;

namespace Medianamik.UI.Mediasend.UserControls
{
    public partial class ucMailingPersonalization : MediasendUserControl
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        #region IMediasendUserControl Members

            public override bool Save()
            {
                if (txtMailingName.Text.Trim() != "" &&
                    txtSenderEmail.Text.Trim() != "" &&
                    txtSubject.Text.Trim() != "")
                {
                    Data.MailingName = txtMailingName.Text;
                    Data.SenderEmail = txtSenderEmail.Text;
                    Data.SenderName = txtSenderName.Text;
                    Data.Subject = txtSubject.Text;
                    return true;
                }
                else
                    return false;
            }

            public override void SetControls()
            {
                txtMailingName.Text = Data.MailingName;
                txtSenderEmail.Text = Data.SenderEmail;
                txtSenderName.Text = Data.SenderName;
                txtSubject.Text = Data.Subject;
            }
        #endregion
    }
}